//
//  YJ_EditViewCell.m
//  YouJoin
//
//  Created by MacBookPro on 15/11/17.
//  Copyright © 2015年 MacBookPro. All rights reserved.
//

#import "YJ_EditViewCell.h"
#import "YJ_HomePageTextField.h"
@implementation YJ_EditViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];
        
//        UIView *editBackView = [[UIView alloc]initWithFrame:CGRectMake(0,10, 320, 50)];
        
        CGFloat textFieldHeight= 30;
        CGFloat padding = 15;
        CGFloat endPadding = 25;
        
        YJ_HomePageTextField *editTextField = [[YJ_HomePageTextField alloc]init];
        editTextField.frame = CGRectMake(0, padding, 320-textFieldHeight, textFieldHeight);
        [self.contentView addSubview:editTextField];
//        [editBackView addSubview:editTextField];
        
        UIButton *editBtn = [[UIButton alloc]init];
//        editBtn.frame = CGRectMake(self.superview.frame.size.width-self.superview.frame.size.height, 0, self.superview.frame.size.height, self.superview.frame.size.height);
        editBtn.frame = CGRectMake(320-textFieldHeight, padding, textFieldHeight, textFieldHeight);
        [editBtn setImage:[UIImage imageNamed:@"homepage_edit"] forState:UIControlStateNormal];
        [self.contentView addSubview:editBtn];
        
//        [self.contentView addSubview:editBackView];
        
        self.cellHeight = endPadding + textFieldHeight + padding;
        
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
